home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir36
/
makn101a.zip
/
MAKENAME.DOC
< prev
next >
Wrap
Text File
|
1992-11-24
|
14KB
|
352 lines
==============================================================================
======================== =======================
======================== MAKENAME =======================
======================== =======================
==============================================================================
MakeName is Copyright (C) 1992
by
Pinnacle Software, CP 386 Mount Royal, Quebec Canada H3P 3C6
U.S. Office: Box 714 Airport Road, Swanton, Vermont 05488 USA
Support Line (514) 345-9578 -- Free Files BBS (514) 345-8654
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is a SHAREWARE product. That means we would like you to
pass around unregistered copies to other people. If you have
a modem, please upload it to your favourite bulletin board
system, or give a copy to a friend who you think might need
a program like this. Shareware means sharing! Pass it on!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Original concept: James Ludwick
Design and coding: Timothy Campbell
Documentation: Natasha Mirage
Distribution: Kevin Beck
Support services: L.Wilson, Z.Krome
==============================================================================
OVERVIEW
==============================================================================
MakeName writes a batch file (named SETNAME.BAT) that uses the DOS SET command
to set a DOS environment variable to an 8-character string which represents
the current date and time. This can then be CALLed by a batch file that needs
such a string for some purpose (usually as part of a file name).
==============================================================================
WHY YOU NEED MAKENAME -- AN EXAMPLE
==============================================================================
Sometimes you want to create a batch file that you will run once in a while,
which will create a data file, but since each file it creates is essentially
another version of the same data, you want to keep it in the same directory as
earlier copies.
The usual way is to code the batch file is like this:
BATCH FILE "NEWDATA.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
MAKEDATA Run a program to make the file
RENAME DATA %1 Rename the data file
You would then call up this batch file as in this example:
NEWDATA FILE0001.DAT
In other words, you are using the variable %1 to represent a unique file name.
The problem with this approach is that you have to keep track of the various
files in the directory. It would be nice to have a program that would create
a unique file name based on the date and time.
That's precisely what MAKENAME does!
==============================================================================
INSTALLATION
==============================================================================
The MakeName program (MAKENAME.EXE) should be placed in your DOS PATH. For an
explanation of the DOS PATH command, consult your DOS manual.
==============================================================================
FILES
==============================================================================
The MakeName package comprises the following files:
ROOTNAME EXT FILE PURPOSE DESCRIPTION
-------- --- ------------- -------------------------------------------------
READ ME Documentation Directs your attentions to MAKENAME.DOC
MAKENAME DOC Documentation How to use the MakeName utility (this file)
VENDOR DOC Documentation Terms for sharing this software with other people
FILE_ID DIZ Documentation (File used by some BBS's) Brief description
DESC SDI Documentation (File used by some BBS's) Brief description
MAKENAME EXE Program The MakeName utility
EXAMPLE1 BAT Batch file Sample usage of MakeName
EXAMPLE2 BAT Batch file Sample usage of MakeName
MN FRM Form/Envelope To register the MakeName utility
==============================================================================
THE FORMAT OF THE VARIABLE
==============================================================================
The MAKENAME program writes a short batch file (named SETNAME.BAT) that uses
the DOS SET command to set a variable according to the date and time. You can
then use this in your batch file, after CALLing it.
The variable is eight characters long. It uses this format:
Format: YMDHHMMS
Examples: 1230405K (Created 1991/02/03, a little after 04:05)
2NP1631P (Created 1992/11/23 [November 23 '92] just after 4:31 PM)
Key: Y ------- Year The last digit (0 to 9); example: 1993 is 3
M ------- Month The month number (1 to 9) or OND (Oct, Nov, Dec)
D ------- Day The day of the month (1 to 9, A to W)
HH ------ Hour Hour of the day; example: 6 PM is 18
MM ------ Minute Minute of the hour
S ------- Second Second (0 to 9, A to V)
The Second value changes every two seconds, rather than every second. The
letters used for Day and Second never include I or O, as these could be
confused with the digits 1 or 0.
For additional examples, you can run the sample batch file EXAMPLE1.BAT, which
generates a series of variables. This batch file is described in the section
entitled "Sample Batch Files".
==============================================================================
USING THE MAKENAME COMMAND
==============================================================================
COMMAND FORMAT
==============
The format of the MAKENAME command is:
MAKENAME varname [time?]
The "varname" parameter is required (not optional). The "time?" parameter is
optional. If both parameters are omitted, the program displays a screen that
summarizes how it is used.
The parameters are as follows:
varname This is the name of the DOS enviroment variable to be SET by the
batch file SETNAME.BAT.
time? (Optional) Set this parameters to N if you don't want the time part
of the variable set. In such case, the variable will be only three
characters long and represent the year, month and day only.
DUPLICATION
===========
Two names created two seconds or less apart will be the same.
Two names created precisely ten years apart will be the same.
EXAMPLES
========
Here are some examples of the MakeName command:
MAKENAME MYVAR
This would write a batch file named SETNAME.BAT, which would SET the variable
named MYVAR to a string representing the date and time. After CALLing the
SETNAME batch file, the variable %MYVAR% could be used in other batch files.
MAKENAME MYFILE N
This would write a batch file named SETNAME.BAT, which would SET the variable
named MYFILE to a string representing the date only. After CALLing the SETNAME
batch file, the variable %MYFILE% could be used in other batch files.
ERRORLEVELS
===========
The success or failure of the MakeName command can be tested within a batch
file by using IF ERRORLEVEL, as follows:
ERRORLEVEL MEANING
---------- -------
0 MakeName worked successfully
255 An error occured
==============================================================================
SAMPLE BATCH FILES
==============================================================================
This section contains two sample batch files. Copies of these batch files are
included in the MAKENAME package, as EXAMPLE1.BAT and EXAMPLE2.BAT.
Here is a sample batch file that demonstrates the use of MAKENAME:
BATCH FILE "EXAMPLE1.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
:AGAIN Batch file label
MAKENAME XYZ Make the SETNAME.BAT file
CALL SETNAME.BAT Call it up
ECHO Variable XYZ is set to %XYZ% Demonstrate
ECHO Press Ctrl-C to quit Tell user how to escape loop
PAUSE Wait for a key
GOTO AGAIN Loop back
Here is a sample batch file that backs up your current directory to diskette.
BATCH FILE "EXAMPLE2.BAT" EXPLANATION
------------------------------------------- ----------------------------------
@ECHO OFF Turn off command echoing
MAKENAME MYVAR Make the SETNAME.BAT file
CALL SETNAME.BAT Call it up
PKZIP -a %MYVAR%.ZIP *.* Save everything in a ZIP file (*)
COPY %MYVAR%.ZIP A: Copy the ZIP file to the diskette
DEL %MYVAR%.ZIP Erase ZIP file
DIR A: Show what's on A:
(*) PKZIP is an excellent file compression program created by PKWare Inc.
(PKWARE, Inc. 7545 N. Port Washington Rd,. Glendale, Wisconsin 53217 USA.)
An alternative is the freeware program LHA, which is available on our
Support BBS (514-345-8654, up to 9600 bps, downloads permitted on first
call.)
==============================================================================
WHAT IS SHAREWARE?
==============================================================================
SHAREWARE is the growing movement of "Try Before You Buy" software: we let
you try out our program, and if you like it, you purchase a registered copy.
By registering, you make it possible for us to create new versions -- we give
registered users 2 years of free registrations. You also make it economical
for us to create specialized programs that you need.
Shareware keeps our costs low, and that means lower prices for you. It works
because we trust you, and we expect you will pay for what you use. (After
all, the authors do have a legal right to receive payment.)
Did you receive shareware from somebody besides the author? In most cases,
the author did not receive a single penny -- even if you paid for the disk.
The author is paid ONLY if you register.
Please support shareware by passing around unregistered copies of the programs
you like, and by registering the programs you use!
See the text file MN.FRM for registration information.
==============================================================================
SHAREWARE TERMS
==============================================================================
STANDARD REGISTRATION: Standard registrations are processed by mail. Remit
the registration by cheque or money order, U.S. or Canadian funds, drawn on
a U.S. or Canadian bank. The text file MN.FRM contains an order form.
REGISTERING ON COMPUSERVE: To register on CompuServe, GO SWREG. Your regis-
tration number is sent to you via email, usually on the same day you register.
(Registration of MakeName on CompuServe is available only after Nov. 27, 1992)
PURCHASE ORDERS: We accept purchase orders from Fortune 500 companies,
government offices (municipal, state, provincial, national), nationally-
disseminated print, radio or television media, and major educational insti-
tutions.
CREDIT-CARDS: The low price of this program makes it impossible for us
to process credit card orders. If you require fast turn-around, we suggest
you use our Instant Registration Service (described below).
REGISTRATION PROVISIONS: Registered owners receive a disk containing the
current latest version of the program, plus bonus software, plus 30 minutes
of dial-in (voice or modem) phone support, plus a 25% discount on upgrades,
plus a registration number that will allow you to automatically register any
new shareware versions we issue for two years after the date of registration.
INSTANT REGISTRATION SERVICE: When you order using our Instant Registration
service, we will phone you as soon as we receive your order to give you your
registration number. This number can be used to register any new shareware
copy of this program for two years. Instant Registration is offered only on
registrations paid by purchase order (if qualified) or money order, or
certified cheque. This service is available in North America only.
SOURCE CODE: Source code may be purchased for personal and in-house use only.
You must be a licensed owner to purchase the source code. Source code may also
be licensed for use in your own commercial product -- call for full details.
PROGRAM CUSTOMIZATION: We can customize to your requirements. Modifications
are performed at our standard contract rate of $35/hr, but this rate may be
reduced, based upon the applicability of your modification to other clients.
PRODUCT SUPPORT: Dial-in support covers the product itself; it does not
cover instruction in DOS or programming.